<include file="Public/header"/>
<style>
    .report-file {display: block;position: relative;width: 120px;height: 34px;  		overflow: hidden;  border: 1px solid #428bca;
        background: none repeat scroll 0 0 #428bca;  color: #fff;  cursor: 			pointer;text-align: center;  float: left;
        margin-right:5px;border-radius: 3px; margin-top: 20px;}
    .report-file span {  cursor: pointer;  display: block;  line-height: 34px; }
    .file-prew {  position: absolute;  top: 0;  left:0;  width: 120px;  height: 		34px; opacity: 0;filter: alpha(opacity=0);  cursor: pointer;  }
</style>
<div class="wrapper m-t">

    <div class="panel panel-info">
        <div class="panel-heading no-padding">
            <div class="panel-options">
                <ul class="nav nav-tabs">
                    <li ><a href="{:U('SystemSet/foundation')}">微信配置</a></li>
                    <li class="active"><a href="{:U('SystemSet/companyConfig')}">公司信息</a></li>
                    <li><a href="{:U('SystemSet/bankConfig')}">银行卡信息</a></li>
                    <li><a href="{:U('SystemSet/restConfig')}">其他</a></li>
                </ul>
            </div>
        </div>
            <div class="panel-body">
                <div class="tab-content">
                    <div id="tab-2" class="tab-pane active">
                        <form class="form-horizontal" method="post" action="{:U('SystemSet/updateInfo')}">
                            <div class="form-group">
                                <label class="col-lg-3 control-label text-left">公司名：</label>
                                <div class="col-lg-5">
                                    <input type="text" name="companyName" class="form-control" value="{$vo.companyname}">
                                </div>
                                <div class="col-lg-4">
                                    <span class="help-block">请填写公司名称</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-lg-3 control-label text-left">公司地址：</label>
                                <div class="col-lg-5">
                                    <input type="text" name="companyAddress" class="form-control" value="{$vo.companyaddress}">
                                </div>
                                <div class="col-lg-4">
                                    <span class="help-block">请填写公司所在地址</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-lg-3 control-label text-left">公司电话：</label>
                                <div class="col-lg-5">
                                    <input type="text" name="linkTel" class="form-control" value="{$vo.linktel}">
                                </div>
                                <div class="col-lg-4">
                                    <span class="help-block">请填写公司电话</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-lg-3 control-label text-left">公司简介：</label>
                                <div class="col-lg-5">
                                    <textarea rows="5" name="companyRemark" class="form-control">{$vo.companyremark}</textarea>
                                </div>
                                <div class="col-lg-4">
                                    <span class="help-block">请填写公司简介</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-lg-3 control-label text-left">邮箱：</label>
                                <div class="col-lg-5">
                                    <input type="email" name="email" class="form-control" value="{$vo.email}">
                                </div>
                                <div class="col-lg-4">
                                    <span class="help-block">公司邮箱地址</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-lg-3 control-label text-left">联系人：</label>
                                <div class="col-lg-5">
                                    <input type="text" class="form-control" name="linkMan" value="{$vo.linkman}">
                                </div>
                                <div class="col-lg-4">
                                    <span class="help-block">公司联系人</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-lg-3 control-label text-left">网站备案号：</label>
                                <div class="col-lg-5">
                                    <input type="text" name="recordsNumber" class="form-control" value="{$vo.recordsnumber}">
                                </div>
                                <div class="col-lg-4">
                                    <span class="help-block"></span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-lg-3 control-label text-left">域名：</label>
                                <div class="col-lg-5">
                                    <input type="text" name="domainName" class="form-control" value="{$vo.domainname}">
                                </div>
                                <div class="col-lg-4">
                                    <span class="help-block">网站域名</span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-lg-3 control-label text-left">公司LOGO：</label>

                                <div class="col-lg-5">
                                    <div class="col-lg-4">
                                        <img id="codeimg" width="120px" height="120px" src="{$vo.logoimg}"/>
                                    </div>

                                    <div class="col-lg-4">
                                        <div class="report-file">
                                            <span>上传LOGO</span>
                                            <input type="file" onchange="ajaxFileUpload()" name="headimgurl" id="file0" class="file-prew">
                                        </div>
                                    </div>

                                </div>
                                <div class="col-lg-4">
                                    <span class="help-block">公司LOGO</span>
                                </div>
                            </div>
                            <input type="hidden" id="logoImg" name="logoImg" value="{$vo.logoimg}"/>
                            <div class="form-group">
                                <label class="col-lg-3 control-label"></label>
                                <div class="col-lg-8">
                                    <input type="submit" target-form="form-horizontal" class="btn btn-primary m-r col-lg-2 ajax-post" value="确定"/>
                                    <input type="button" class="btn btn-info col-lg-2" onclick="javascript:history.back(-1);return false;" value="返回"/>
                                </div>
                            </div>

                        </form>
                    </div>
                </div>
            </div>
        </div>

</div>
<include file="Public/footer"/>
<script src="__PUBLIC__/Static/js/ajaxfileupload.js"></script>

<script>
    //异步图片上传
    function ajaxFileUpload() {
        $.ajaxFileUpload({
            url: "{:U('Mobile/Wap/touxiang')}", //用于文件上传的服务器端请求地址
            secureuri: false, //是否需要安全协议，一般设置为false
            fileElementId: 'file0', //文件上传域的ID
            dataType: 'json', //返回值类型 一般设置为json
            async:false,
            success: function (data, status){ //服务器成功响应处理函数
                console.log(data);
                if(data.state=='success'){
                    $("#codeimg").attr('src',data.info);
                    $("#logoImg").val(data.info);

                }else{
                    alert('上传失败');
                }
            },
            error: function (data, status, e){ //服务器响应失败处理函数
                alert(e);
            }
        })
        return false;
    }
</script>